Add "archive" as an alias for "archive-z2"
authorColin Walters <walters@verbum.org>
Thu, 16 Jun 2016 14:07:26 +0000 (10:07 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 16 Jun 2016 14:34:23 +0000 (14:34 +0000)
I find the "-z2" is really a long ago relic of the past when I changed
the format.  We no longer have anything to do with the original
`archive`, so let's start allowing people to type `--mode=archive`
which just looks saner.

At some point later I'll update the docs too, but it'll be an annoying
transition period as we'll have to say "On older OSTree, use -z2" etc.

Closes: #346
Approved by: giuseppe

src/libostree/ostree-repo.c
tests/basic-test.sh

index c40abb7810b280a841a69fb55037b3974082a08f..5e3e31df7b8ff78488edab020aec3b63e76642d1 100644 (file)
@@ -1816,7 +1816,8 @@ ostree_repo_mode_from_string (const char      *mode,
     ret_mode = OSTREE_REPO_MODE_BARE;
   else if (strcmp (mode, "bare-user") == 0)
     ret_mode = OSTREE_REPO_MODE_BARE_USER;
-  else if (strcmp (mode, "archive-z2") == 0)
+  else if (strcmp (mode, "archive-z2") == 0 ||
+           strcmp (mode, "archive") == 0)
     ret_mode = OSTREE_REPO_MODE_ARCHIVE_Z2;
   else
     {
index 0fe372dc870505b3e904879876795e290bc4695c..003df893367bd1bfb0a1c9c53955c45d855d71ef 100755 (executable)
@@ -278,7 +278,7 @@ echo "ok prune"
 
 cd ${test_tmpdir}
 rm repo3 -rf
-${CMD_PREFIX} ostree --repo=repo3 init --mode=archive-z2
+${CMD_PREFIX} ostree --repo=repo3 init --mode=archive
 ${CMD_PREFIX} ostree --repo=repo3 pull-local --remote=aremote repo test2
 rm repo3/refs/remotes -rf
 mkdir repo3/refs/remotes
@@ -405,7 +405,7 @@ echo "ok commit of fifo was rejected"
 cd ${test_tmpdir}
 rm repo2 -rf
 mkdir repo2
-${CMD_PREFIX} ostree --repo=repo2 init --mode=archive-z2
+${CMD_PREFIX} ostree --repo=repo2 init --mode=archive
 ${CMD_PREFIX} ostree --repo=repo2 pull-local repo
 rm -rf test2-checkout
 ${CMD_PREFIX} ostree --repo=repo2 checkout -U --disable-cache test2 test2-checkout